python counting occurrence of element in linked list using recursion